﻿<phone:PhoneApplicationPage
    x:Class="desarrolloMobile.DGTViewer.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" xmlns:Controls="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls" mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696" 
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True">
	<phone:PhoneApplicationPage.ApplicationBar>
		<shell:ApplicationBar Mode="Minimized">
            <shell:ApplicationBarIconButton x:Name="filtrosButton" IconUri="/icons/appbar.feature.search.rest.png" Text="filtros" Click="filtrosButton_Click"/>
			<!--<shell:ApplicationBarIconButton x:Name="configButton" IconUri="/icons/appbar.feature.settings.rest.png" Text="configuracion"/>-->
			<shell:ApplicationBarIconButton x:Name="acercaButton" IconUri="/icons/appbar.questionmark.rest.png" Text="acerca de" Click="acercaButton_Click"/>
			<shell:ApplicationBarIconButton x:Name="fuenteButton" IconUri="/icons/appbar.download.rest.png" Text="Fuente" Click="CambioFuente"/>
		</shell:ApplicationBar>
	</phone:PhoneApplicationPage.ApplicationBar>

    <!--Data context is set to sample data above and LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="Información de la DGT" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="incidencias" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel contains ListBox and ListBox ItemTemplate. Place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,15,12,0">
            <ListBox x:Name="MainListBox" Margin="8,0,-20,44" ItemsSource="{Binding Incidencias}" SelectionChanged="MainListBox_SelectionChanged">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                      <Grid x:Name="grid" Margin="0" RenderTransformOrigin="0.5,0.5">
                      	<Grid.RenderTransform>
                      		<CompositeTransform/>
                      	</Grid.RenderTransform>
                      	<Grid.ColumnDefinitions>
                      		<ColumnDefinition Width="89"/>
                      		<ColumnDefinition Width="217"/>
                      		<ColumnDefinition Width="145"/>
                      	</Grid.ColumnDefinitions>
                      	<Grid.RowDefinitions>
                      		<RowDefinition Height="43"/>
                      		<RowDefinition Height="55"/>
                      	</Grid.RowDefinitions>
                    		<TextBlock Text="{Binding Poblacion}"  TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" Margin="46,0,1,0" d:LayoutOverrides="Height" FontSize="32" Grid.ColumnSpan="3"/>
                    		<TextBlock Text="{Binding Carretera}" TextWrapping="Wrap" Margin="8,0,0,0" Style="{StaticResource PhoneTextSubtleStyle}" Grid.Row="1" d:LayoutOverrides="Width"/>
                    		<TextBlock Margin="0" TextWrapping="Wrap" Text="{Binding Causa}" Grid.Row="1" Grid.Column="1"/>
                    		<TextBlock Margin="0,0,57,0" TextWrapping="Wrap" Text="{Binding Incial}" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Right"/>
                    		<TextBlock HorizontalAlignment="Right" TextWrapping="Wrap" Text="{Binding Final}" Grid.Row="1" Margin="0,0,1,0" Grid.Column="2"/>
                    		<TextBlock HorizontalAlignment="Left" Margin="2,0,0,0" TextWrapping="Wrap" Text="Km." FontSize="18.667" Grid.Row="1" Grid.Column="2"/>
                    		<Image HorizontalAlignment="Left" Margin="0,0,0,1" Width="40" Source="{Binding ImgPath}"/>
                    	</Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
        <TextBlock x:Name="txtHora" Height="21" Grid.Row="1" TextWrapping="Wrap" Text="{Binding Hora}" VerticalAlignment="Bottom" FontSize="13.333" FontFamily="Segoe WP SemiLight" TextAlignment="Center"/>
        <Controls:ProgressOverlay 
            Name="_performanceProgressBar">
            <Controls:ProgressOverlay.Content>
                <TextBlock>Actualizando</TextBlock>
            </Controls:ProgressOverlay.Content>
        </Controls:ProgressOverlay>
        <TextBlock x:Name="txtFiltro" Height="39" Margin="39,0,12,-11" TextWrapping="Wrap" Text="Mostrando todas las incidencias" VerticalAlignment="Bottom"/>

    </Grid>
 
    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>